/****************************************************
// 功能：
// | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
// | Copyright (c) 2021-2025 聊来 All rights reserved.
// | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">聊来</a> )
// | @Author: 贯彻己道的云 <18970881148@qq.com>
// | DateTime: 2025/2/18 14:57:24
*****************************************************/

using Net.Common;
using UnityEngine;

public class BaseController<T> : SingletonPatternBase<T> where T : SingletonPatternBase<T>, new()
{
    protected ResourceManager resource;
    protected ModelManager model;
    protected NetManager net;
    protected UIManager ui;
    protected AudioManager audioManager;

    public virtual void InitController()
    {
        resource = ResourceManager.Instance;
        model = ModelManager.Instance;
        net = NetManager.Instance;
        ui = UIManager.Instance;
        audioManager = AudioManager.Instance;
    }
    
    public void SendByTcp(RequestType type, object data)
    {
        net.SendByTcp(type, data);
    }
    public void SendByKcp(RequestType type, object data)
    {
        net.SendByKcp(type, data, model.userInfo.channelId);
    }
    
    public void SendByWebSocket(RequestType type, object data)
    {
        net.SendByWebSocket(type, data);
    }
}
